package j2s.xmlType;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;

import address5.PurchaseOrderType;

public class Main {
	public static void main(String[] args) throws Exception {

		// Demonstrates shipping and billing data printed in the property
		// order defined by the propOrder annotation element in class
		// USAddress.
		JAXBContext jc = JAXBContext.newInstance(PurchaseOrderType.class);
		Unmarshaller u = jc.createUnmarshaller();
		try {
			PurchaseOrderType poType = (PurchaseOrderType) u
					.unmarshal(Main.class.getResourceAsStream("testData.xml"));
			System.out.println(poType.toString());
		} catch (javax.xml.bind.UnmarshalException e) {
			System.out.println("Main: " + e);
		}
	}
}
